/* Ejercicio 4.15
   ejer4_15.c */
#include <stdio.h>
#include <math.h>

/* funcion main, el programa inicia aca */
int main( void )
{
    double amount;
    double principal = 1000.0;
    double rate;
    int year, interest;

    for ( interest = 5; interest <= 10; interest++ ) {
        rate = interest / 100.0;
        printf( "Interest rate: %d%%\n", interest );
        printf( "%4s%21s\n", "Year", "Amount on deposit" );

        for ( year = 1; year <= 10; year++ ) {
            amount = principal * pow( 1.0 + rate, year );

            printf( "%4d%21.2f\n", year, amount );
        }
    }

	return 0;
} /* fin de la funcion main */
